Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce addDeferredSql method in migration class #1478

Open
wants to merge 1 commit into
base: 4.0.x
Choose a base branch
from

Conversation

srsbiz
Copy link
Contributor

@srsbiz srsbiz commented Dec 14, 2024

Q A
Type feature
BC Break no

Summary

This will allow to add queries that needs to be executed after changes made to schema object.

Reason for this change

When people need to write data in newly created table / added column, they probably resorts to calling $this->connection->executeStatement in postUp, and this may be wrong in at least two scenarios:

  1. When testing migration with --dry-run option, executeStatement is always called, since migration does not know about dry-run mode
  2. Such SQLs are not visible if executed with -vv or --write-sql options, since executeStatement does not log queries like addSql.

@srsbiz srsbiz changed the title Introduce addDefferedSql method in migration class Introduce addDeferredSql method in migration class Dec 16, 2024
This will allow to add queries that needs to be executed after changes
made to schema object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant